def run(params:list[str]):
    import json
    from ApiBase import apiBase

    content = apiBase.argv(1,'''{
        "content": "LS0tLWJsb2NrbmFtZTAwMDAwCiBiPTEKIC0tLS1ibG9ja25hbWUwMDAwMQo=",
        "blockname": "----blockname",
        "express": [
            "aWYgYT0xIGVuZA==",
            "aWYgYyA9MSBlbmQ="
        ]
    }''')
    # 解析为Python字典
    try:
        mapval=json.loads(content)
        content=apiBase.decode64(mapval['content'])
        express=apiBase.decode64(mapval['express'])
        blockname=mapval['blockname']
        #替换---block
        sz=len(express)
        for i in range(sz):
            express[i]=apiBase.decode64(express[i])
        for i in range(100000):
            if content.find(blockname) == -1:
                break
            for i in range(sz):
                content=content.replace(f"{blockname}{i:05}",express[i])

        print(content)
    except Exception as e:
        print(f"JSON解析错误: {e}")
    finally:
        apiBase.close()
